﻿#region Header
/*
 * name：IAuthorizationProvider
 * author：Kain
 * date：11/25/2010 11:40:13 AM
 *********************************************
 * History:
 * $Header$
 * $History$
 */
#endregion

#region imported namespace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cherry.Agile.Framework.Common;
#endregion

namespace Cherry.Agile.Security
{

    /// <summary>
    /// 用户验证提供实现接口
    /// </summary>
	public interface IAuthorizationProvider
	{
        /// <summary>
        /// 验证用户
        /// </summary>
        /// <param name="ticket">用户唯一身份标识</param>
        /// <returns>用户信息</returns>
        User Authorize(ITicket ticket);

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="identity">用户唯一身份标识</param>
        /// <returns>用户信息</returns>
        User GetUser(ITicket identity);

        /// <summary>
        /// 获取用户的角色信息
        /// </summary>
        /// <param name="identity">用户</param>
        /// <returns>用户角色</returns>
        Role[] GetUserRoles(ITicket identity);

        /// <summary>
        /// 获取用户组织信息
        /// </summary>
        /// <param name="identity">用户</param>
        /// <returns>用户组织信息</returns>
        Organization[] GetUserOrgs(ITicket identity);

        ///// <summary>
        ///// 获取缓存数据槽
        ///// </summary>
        ///// <returns></returns>
        //ICacheStorage CacheStorage{get;}

        ///// <summary>
        ///// 用户票据提供器
        ///// </summary>
        ///// <returns></returns>
        //ITokenProvider TokenProvider{get;}

        Application[] GetApplicationInfos();
        
	}
}
